package com.hxkj.dao.impl;

import com.hxkj.dao.CommonMessageDao;
import com.hxkj.mapper.CommonMessageMapper;
import com.hxkj.domain.po.CommonMessage;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


/**
* 数据操作实现
*
* @author: chenwei
* @version: 1.0
* @datetime: 2018-07-09 18:25:03
*
*/
@Service("commonMessageDao")
public class CommonMessageDaoImpl implements CommonMessageDao {

    @Resource
    private CommonMessageMapper commonMessageMapper;

    @Override
    public CommonMessage get(String id) {
        return commonMessageMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<CommonMessage> get(CommonMessage commonMessage) {
        return commonMessageMapper.select(commonMessage);
    }

    @Override
    public int delete(String id) {
        return commonMessageMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int delete(CommonMessage commonMessage) {
        return commonMessageMapper.delete(commonMessage);
    }

    @Override
    public int save(CommonMessage commonMessage) {
        return commonMessageMapper.insert(commonMessage);
    }

    @Override
    public int update(CommonMessage commonMessage) {
        return commonMessageMapper.update(commonMessage);
    }
}
